#include "test.h"
#include <stdlib.h>
#include <math.h>

static Application testingApplication("Random Name");




Test::Test() : Node(500 * MILLISECONDS)
{
	//calculate angular frequency
	omega = 2*M_PI*(1/(91.4887*MINUTES));
	//seed random number generator
	srandom(NOW());
}

Test::~Test() {

}

StatusData* Test::work() {
	//Generate data (inertial system, x = vernal equinox)
	status.posX = cos(omega*NOW()) * 353;
	status.posY = sin(omega*NOW()) * 353;
	status.posZ = sin(omega*NOW()) * 276.6437;
	status.temperature = sin(omega*NOW()) * 100.1 - 1.2;



	//Wait (to simulate more working)
	waitUntil(NOW()+400 * MILLISECONDS);
	//Publish data
	return &status;
}


